-- GENERATED SPELL FOR [Centipaar Swarmer] --


function spell0_5457(pUnit, Event) --@Silithid Swarm,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(6589,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_5457', 1, 1)
end

function spell1_5457(pUnit, Event) --@Silithid Swarm,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(10722,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_5457', 1, 1)
end

function spell2_5457(pUnit, Event) --@Thrash,Self--
pUnit:FullCastSpellOnTarget(3391,pUnit)
pUnit:RegisterEvent('Sorts_5457', 535, 1)
end

function Sorts_5457(pUnit, Event)
local choix_sorts_5457 = math.random(0, 2)
if choix_sorts_5457 == 0 then
pUnit:RegisterEvent('spell0_5457', 1, 1)
end
if choix_sorts_5457 == 1 then
pUnit:RegisterEvent('spell1_5457', 1, 1)
end
if choix_sorts_5457 == 2 then
pUnit:RegisterEvent('spell2_5457', 1, 1)
end
end

function mob5457_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5457', math.random(1500, 3000), 1)
end

function mob5457_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5457_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5457_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5457, 1, 'mob5457_Action')
RegisterUnitEvent(5457, 2, 'mob5457_Leave')
RegisterUnitEvent(5457, 3, 'mob5457_Kill')
RegisterUnitEvent(5457, 4, 'mob5457_Die')
